import request from '@/utils/requestH2'

// 获取物料列表
export function selMaterialRequisitionListApi(params) {
  return request({
    url: '/materialRequisition/selMaterialRequisitionList',
    method: 'GET',
    params
  })
}

// 新增材料领用单
export function addMaterialRequisitionApi(data) {
  return request({
    url: '/materialRequisition/addMaterialRequisition',
    method: 'POST',
    data
  })
}

// 根据id修改材料领用单
export function updateMaterialRequisitionByIdApi(data) {
  return request({
    url: `/materialRequisition/updateMaterialRequisitionById/${data.id}`,
    method: "PUT",
    data: {
      goodsId: data.goodsId,
      number: data.number,
      operatorId: data.operatorId,
      remark: data.remark,
      type: data.type,
      directorId : data.directorId,
      projectName: data.projectName,
    },
  });
}

// 根据id删除材料领用单
export function delMaterialRequisitionByIdApi(id) {
  return request({
    url: `/materialRequisition/delMaterialRequisitionById/${id}`,
    method: 'DELETE'
  })
}

// 查询待审集合
export function selDepartmentHeadInspectListApi(params) {
  return request({
    url: '/departmentHead/selDepartmentHeadInspectList',
    method: 'GET',
    params
  })
}

// 部门负责人根据id审批
export function updateDepartmentHeadInspectByIdApi(data) {
  return request({
    url: `/departmentHead/updateDepartmentHeadInspectById`,
    method: 'PUT',
    data
  })
}

// 项目负责人查询待审集合
export function selProjectHeadInspectListAPi(params) {
  return request({
    url: "/projectHead/selProjectHeadInspectList",
    method:'GET',
    params
  });
}

// 项目负责人根据id审批
export function updateProjectHeadInspectByIdApi(data) {
  return request({
    url: "/projectHead/updateProjectHeadInspectById",
    method:'PUT',
    data
  });
}

